import createAxios from '/@/utils/axios'
import { useAdminInfo } from '/@/stores/adminInfo'

const controllerUrl = '/admin/index/'

export function index() {
    return createAxios({
        url: controllerUrl + 'index',
        method: 'get',
        //decompress:true //如果不需要返回解密就加这个
    })
}
//登录
export function login(method: 'get' | 'post', params: object = {}): ApiPromise {
    return createAxios({
        url: controllerUrl + 'login',
        data: params,
        method: method,
    }) as ApiPromise
}
//注销
export function logout(): ApiPromise {
    return createAxios({
        url: controllerUrl + 'logout',
        method: 'POST',
    }) as ApiPromise
}
